package com.gimi.cloud.bbp.manage.controller.order;



import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.gimi.cloud.bbp.common.enums.ResponseCodeEnum;
import com.gimi.cloud.bbp.common.utils.reqhead.Response;
import com.gimi.cloud.bbp.dto.order.OrderLogisticsDTO;
import com.gimi.cloud.bbp.manage.service.order.OrderLogisticsService;
                                                                                                                                                                                                                     /**
 * 订单管理
 * @author chendi
 * @date 2018年1月10日
 */
@RestController
@RequestMapping(value = "orderLogistics")
public class OrderLogisticsController {
	
	@Autowired
    private OrderLogisticsService orderLogisticsService;
	
	/** 获得单个订单物流信息 */
    @RequestMapping(value = "/getSingleOrderLogistics")
    public Response getSingleOrderLogistics(@RequestBody OrderLogisticsDTO DTO, HttpServletResponse response) throws Exception {
    	Response resp = new Response();
    	OrderLogisticsDTO logisticsDTO = orderLogisticsService.getSingleOrderLogistics(DTO);
    	resp.setRes_data(logisticsDTO);
        resp.setResponseCode(ResponseCodeEnum.SUCCESSED);
        return resp;
    }
    
    
    /** 修改订单物流信息 */
    @RequestMapping(value = "/updateOrderLogistics")
    public Response updateOrderLogistics(@RequestBody OrderLogisticsDTO DTO, HttpServletResponse response) throws Exception {
    	Response resp = new Response();
    	orderLogisticsService.updateOrderLogistics(DTO);
    	resp.setResponseCode(ResponseCodeEnum.SUCCESSED);
    	return resp;
    }
    /**删除**/
    @RequestMapping(value = "/deleteOrderLogistics")
    public Response deleteOrderLogistics(@RequestBody OrderLogisticsDTO DTO, HttpServletResponse response) throws Exception {
    	Response resp = new Response();
    	orderLogisticsService.deleteOrderLogistics(DTO);
    	resp.setResponseCode(ResponseCodeEnum.SUCCESSED);
    	return resp;
    }
    
    
}
